<?php
    require_once $_site->get_handlepath('device');

	$id = request('id');
	$info=device_fun_get_record($id);		
		
	$onloadType=array(1=>"空车",2=>"重车");
	require_once("header.php");
	
	require_once $_site->get_handlepath('admin');
	$xinfo=admin_fun_find_admin($info['xid']);
	
	$onloadType=array(1=>"取土点",2=>"倒土点");
	
	
	
		
?>

	<script type="text/javascript" charset="utf-8">
		loader.file({
			plugin:['validform/main','dialog/main','my97/wdatepicker'],
			skincss:['list']
		})
		
		function agree(){
			$.post("/handle.php",$("#form1").serialize(),function(res){
				if(res.state){					
					parent.change(res.info);
					return;
				}
				alert(res.msg);
				},'json');            
		}
	</script>
	<style type="text/css">
		.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
	</style>
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/edits">
      <input type="hidden" name="id" value="<?php echo $id?>">
	  
        <table cellpadding="0" cellspacing="1" border="0" class="table">	  
		  <tr>
		     <td valign="top" style="height:200px;width:40%;padding:2px;">
			   <img src="<?php $img=1==$info['delimg']?'/static/images/imgdel.jpg':$info['img'];echo $img ;?>" width="100%">
			 </td>
			 <td>
			 
		<table cellpadding="0" cellspacing="1" border="0" class="table" style="width:98%;">
			
			<tr>
			    <td>设备号</td>
				<td style="text-align: left">
					<strong><?php echo $info['dno']?></strong>
				</td>
			    <td>登记时间</td>			
				<td style="text-align: left">
					<?php echo date('Y-m-d H:i:s',$info['ctime'])?>
				</td>			
			</tr>
			
			<tr>
			    <td>负责人</td>			
				<td style="text-align: left">
				<?php echo $xinfo['name']?>
			     </td>				
			    <td>车牌号</td>			
				<td style="text-align: left">
				    <?php echo $info['dname']?>
			    </td>
			</tr>				
			
			<tr>
			    <td>产权人</td>			
				<td style="text-align: left">
				    <?php echo $info['downer']?>
				</td>			
			    <td>车型</td>			
				<td style="text-align: left">
				    <?php echo $info['car_type']?>
				</td>															
			</tr>	
						
			<tr>
			    <td>机车手</td>			
				<td style="text-align: left">
					<?php echo $info['doper']?>
				</td>			
			    <td>车手电话</td>			
				<td style="text-align: left">
				    <?php echo $info['dophone']?>
				</td>				
			</tr>			
						
			<tr>
			    <td>司机编号</td>			
				<td colspan="3" style="text-align: left">
					<?php echo $info['sjno']?>
				</td>						
			</tr>							
						
			<tr>
			    <td>挖机编号</td>
				<td style="text-align: left">										
					<input style="width:120px" type="text" name="wj_no" value="<?php echo $info['wj_no']; ?>">				
				</td>
			    <td>挖机型号</td>			
				<td style="text-align: left">					
					<input style="width:120px" type="text" name="wj_xh" value="<?php echo $info['wj_xh']; ?>">				
				</td>				
			</tr>	
		
			<tr>
			    <td>线路编号</td>
				<td style="text-align: left">					
					<input style="width:120px" type="text" name="line" value="<?php echo $info['line']; ?>">				
				</td>
			    <td>行驶里程</td>
				<td style="text-align: left">					
                    <b><?php echo $info['disall']; ?></b> 米
				</td>				
			</tr>		
			
			<tr>
                <td>运距编号</td>
                <td style="text-align: left">
                    <input style="width:120px" type="text" name="yunno" value="<?php echo $info['yunno']; ?>">
                </td>
			    <td>登记状态</td>
				<td style="text-align: left">
					<select name="posi">
					  <?php
                        foreach($onloadType as $key=>$val){
                        ?>
                        <option value="<?php echo $key?>"  <?php if($key==$info['posi']){echo "selected";} ?>><?php echo $val;?></option>
                        <?php 	
                        }
					  ?>
					</select>					
				</td>
			</tr>	
				
			<?php if($cookie['group']!=12){?>	
			<tr>
				<td colspan="4" >
                      <input type="button" value="修  改" class="button1" onclick="agree()">&nbsp;&nbsp;                      
				</td>
			</tr>
			<?php }?>
		</table>			 
			 
			 </td>
		  </tr>
		</table>
	  
	</form>	
	</div>
</body>
</html>